package ooday03.T1;

public class Test {
    public static void main(String[] args) {
//        Dog dog = new Dog("小黑", 3, "黑色");
//        System.out.println(dog.name);
//        dog = null;
//        System.out.println(dog.name);

        Dog[] dogs = new Dog[3];
        dogs[0] = new Dog("糖糖", 4, "棕黄色");
        dogs[1] = new Dog("小白", 3, "白色");
        dogs[2] = new Dog("小黑", 21, "黑色");
        System.out.println(dogs[0].name);
        dogs[1].age = 5;
        dogs[2].swim();
        for (int i = 0; i < dogs.length; i++) {
            System.out.println(dogs[i].name);
            dogs[i].eat();
        }
    }
}
